﻿<UserControl x:Class="Demos.Puzzles.Polyominoes.Visor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Name="visor">
    <Grid>
        <ItemsControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                      ItemsSource="{Binding ElementName=visor, Path=Tablero}"
                      BorderBrush="Transparent">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <ItemsControl ItemsSource="{Binding Lista}" BorderBrush="Transparent">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"></StackPanel>
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Border Height="{Binding Lado}" Width="{Binding Lado}" BorderBrush="Black" BorderThickness="1">
                                    <Grid Background="{Binding Fondo}">
                                    </Grid>
                                </Border>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Grid>
</UserControl>
